/* 公司设置模块相关的API */

import request from "@/request/request"

/* 根据id查询企业的接口 */
export const findCompanyDetailAPI = (id) => {
  return request({
    url: `/company/${id}`,
    method: 'GET'
  })
}

/* 获取角色列表的接口 */
export const getRoleListAPI = (params) => {
  return request({
    url: '/sys/role',
    method: 'GET',
    params
  })
}

/* 删除角色的接口 */
export const deleteRoleAPI = (id) => {
  return request({
    url: `/sys/role/${id}`,
    method: 'DELETE'
  })
}

/* 新增角色的接口 */
export const addRoleAPI = (data) => {
  return request({
    url: '/sys/role',
    method: 'POST',
    data
  })
}

/* 获取角色详情的接口 */
export const findRoleDetailAPI = (id) => {
  return request({
    url: `/sys/role/${id}`,
    method: 'GET'
  })
}

/* 修改角色详情的接口 */
export const updateRoleAPI = (data) => {
  return request({
    url: `/sys/role/${data.id}`,
    method: 'PUT',
    data
  })
}

/* 给角色分配权限的接口 */
export const assignPremAPI = (data) => {
  return request({
    url: '/sys/role/assignPrem',
    method: 'PUT',
    data
  })
}
